package app

import (
	"context"

	"gitee.com/mkwchecking/sr-core/config/source"
	"gitee.com/mkwchecking/sr-core/domain"
	"github.com/go-kratos/kratos/v2/transport"
)

type IApp interface {
	// 初始化子模块
	Install(ctx context.Context, force bool) error

	// 添加子模块
	AddDomain(module domain.IDomain) IApp

	Source() source.ISource

	// 获取当前上下文
	Context() context.Context

	AddServer(srv transport.Server) error

	// 获取meta信息
	Meta() map[string]string

	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}
